1. Field of the Invention
The present invention generally relates to data processing and more particularly to providing access to saved abstract queries via standard query language constructs, such as Structured Query Language (SQL) constructs.
2. Description of the Related Art
Databases are computerized information storage and retrieval systems. A relational database management system is a computer database management system (DBMS) that uses relational techniques for storing and retrieving data. The most prevalent type of database is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways. A distributed database is one that can be dispersed or replicated among different points in a network. An object-oriented programming database is one that is congruent with the data defined in object classes and subclasses.
Regardless of the particular architecture, in a DBMS, a requesting entity (e.g., an application or the operating system) demands access to a specified database by issuing a database access request. Such requests may include, for instance, simple catalog lookup requests or transactions and combinations of transactions that operate to read, change and add specified records in the database. These requests are made using high-level query languages such as the Structured Query Language (SQL) and application programming interfaces (API's) such as Java® Database Connectivity (JDBC). For example, SQL is used to make interactive queries for getting information from and updating a database such as International Business Machines' (IBM) DB2, Microsoft's SQL Server, and database products from Oracle, Sybase, and Computer Associates. The term “query” denominates a set of commands for retrieving data from a stored database. Queries take the form of a command language, such as SQL, that lets programmers and programs select, insert, update, find out the location of data, and so forth.
Unfortunately, generating queries using SQL may require a detailed understanding of the possibly complex physical layout of the underlying database and interpretation of cryptic field names. For some applications, to facilitate the query building process, an abstraction model may be utilized that, in effect, hides some of the complexities of the underlying database physical layout from users. The abstraction model may include logical fields with recognizable names that map to corresponding physical fields of the underlying database. “Abstract” queries may be generated that contain conditions based on the logical fields. Upon issuance, the logical fields of an abstract query may be mapped to corresponding physical fields to create a “concrete” query. For some applications, abstract queries may be saved, allowing subsequent users to reuse the saved abstract queries without having to generate their own. The concepts of data abstraction and abstract queries are described in detail in the commonly owned, co-pending application Ser. No. 10/083,075, entitled “Improved Application Portability And Extensibility Through Database Schema And Query Abstraction,” filed Feb. 26, 2002, herein incorporated by reference in its entirety.
While abstraction models and saved abstract queries make it easier and more efficient for users to access data, use of SQL and API's such as JDBC and ODBC will likely continue to be used for at least two reasons. First, SQL is a widely used language for extracting and manipulating data residing in databases, especially relational databases. In fact, a large number of existing applications rely on SQL, JDBC and ODBC to handle database transactions from within the particular applications. Second, some users simply prefer to use SQL as a data analysis and reporting tool. SQL, while cumbersome to use, does offer a tremendous amount of functionality for manipulating and presenting data.
It would be desirable to be able to utilize this functionality in conjunction with saved abstract queries, for example, allowing those comfortable with standard query languages, such as SQL, to generate queries based on saved abstract queries. Unfortunately, as they are currently configured, standard query languages cannot be used to access saved abstract queries. Accordingly, there is a need for providing access to saved queries in query statements generated with standard query languages, such as SQL.